/**
 * *****************************************************************
 * @file    adt3102_i2c.c
 * @author  WuHao(hwu@andartechs.com.cn)
 * @version 1.0.0
 * @date    2020-11-24
 * @brief
 *
 *                 Copyright (c) 2020, Andar Technologies Inc.
 *                           www.andartechs.com 
 *
 * *****************************************************************
 */
#ifndef __I2C_H
#define __I2C_H

/*------------------------------ include -------------------------------------*/
#include "adt3102_type_define.h"
#include "i2c_ctype_map.h"


/*------------------------------ function ------------------------------------*/
/**
 * @brief   iic0 and iic1 setting.
 * @param   i2cX: iic include iic0 iic1.
 * @return  None.
 * @note
 */
void i2cInit(I2C_TypeDef *i2cX);

/**
 * @brief   iic0 and iic1 receive 1byte data.
 * @param   i2cX: iic include iic0 iic1.
 * @return  None.
 * @note
 */
uint8 iicRecvByte(I2C_TypeDef *i2cX);

void iicStart(I2C_TypeDef *i2cX);

void iicStop(I2C_TypeDef *i2cX);

void iicSlaveAddr(I2C_TypeDef *i2cX, uint8 writeAddr);

/**
 * @brief   iic0 and iic1 send 1byte data.
 * @param   i2cX: iic include iic0 iic1.
 * @param   DataToWrite: Data written.
 * @return  None.
 * @note
 */
void iicSendByte(I2C_TypeDef *i2cX,  uint8 DataToWrite);
#endif
